EventObject = {}
EventObject.CallBack = {}
function EventObject:Create()
	-- body
	local p = {}
	setmetatable(p,EventObject)
    EventObject.__index=EventObject
    p.CallBack = {}
	return p
end

function EventObject:Invoke(...)
    
    for i, v in pairs(self.CallBack) do
        v(...)
    end
end
function EventObject:AddCallBack(func)
    table.insert(self.CallBack, func)
end

function EventObject:RemoveCallBack(func)
    for i, v in pairs(self.CallBack) do
        if v == func then
            table.remove(self.CallBack, i)
            break
        end
    end
end
function EventObject:Clear()
    self.CallBack = {}
end
